package mspbots.next.ticket.core.grader;


import com.fasterxml.jackson.databind.JsonNode;
import mspbots.next.ticket.core.points.PointResult;
import org.springframework.context.annotation.Scope;
import reactor.core.publisher.Mono;

/**
 * com.mspbots.core.ticketai.TicketRuleInterceptor
 *
 * @author Alex bob(https://github.com/vnobo)
 * @date Created by 2019/8/20
 */
public interface GradeRuleInterceptor {

    /**
     * by prepare rules params
     *
     * @param gradeRuleInterceptorRegistration this rules tenant id
     * @return default GradeResult
     */
    default Mono<GradeRuleInterceptorRegistration> prepare(GradeRuleInterceptorRegistration gradeRuleInterceptorRegistration) {
        return Mono.just(gradeRuleInterceptorRegistration);
    }

    /**
     * by ticket grade default mono;
     *
     * @param ticket this ticket
     * @return default GradeResult
     */
    Mono<PointResult> scoring(JsonNode ticket);
}
